gdkwindow: Fix update area calculations for native subwindows
authorAlexander Larsson <alexl@redhat.com>
Tue, 2 Sep 2014 14:22:12 +0000 (16:22 +0200)
committerAlexander Larsson <alexl@redhat.com>
Tue, 2 Sep 2014 15:14:59 +0000 (17:14 +0200)
When recursing the update area down into native subwindows we forgot
to apply the native window position. This caused us to repaint the
wrong thing in certain cases. I noticed this when playing with the
wip/gdk-gl branch, because it was triggering unnecessary repaints
of the (native window) gl widgets.

gdk/gdkwindow.c

index b9b2e28b704d49f04fe100faf4b58eb7c0a2b254..0460ffca81f90230bb4161c686f192f33d64bbc6 100644 (file)
@@ -3762,23 +3762,18 @@ invalidate_impl_subwindows (GdkWindow            *window,
          if (gdk_window_has_impl (child))
            {
              cairo_region_t *tmp = cairo_region_copy (region);
-             cairo_region_translate (tmp, -dx, -dy);
+             cairo_region_translate (tmp, -dx - child->x, -dy - child->y);
              gdk_window_invalidate_maybe_recurse_full (child,
                                                        tmp, child_func, user_data);
              cairo_region_destroy (tmp);
            }
          else
            {
-             dx += child->x;
-             dy += child->y;
              invalidate_impl_subwindows (child,
                                          region,
                                          child_func, user_data,
-                                         dx, dy);
-             dx -= child->x;
-             dy -= child->y;
+                                         dx + child->x, dy + child->y);
            }
-
        }
     }
 }